package com.hspedu.extend_;

public class ExtendsDetail {
    public static void main(String[] args) {
        System.out.println("===第1个对象===");
        Sub sub1 = new Sub("jack",30);//创建子类对象
        System.out.println("===第2个对象===");
        Sub sub2 = new Sub("jack");

    }

    public static class Graduate {
        public String name;
        public int age;
        private double score;

        //单独要给一个属性建set，则直接在这里输入set,就会有提示
        public void setScore(double score) {
            this.score = score;
        }

        public void testing (){
            System.out.println("大学生 " + name + " 正在考大学数学.。");
        }

        public void showInfo(){
            System.out.println("学生名 " + name + " 年龄 " + age + " 成绩 " + score);
        }
    }
}
